package controllers

import ctrl "github.com/hanc00l/nemo_go/pkg/web/controllers"

type VulController struct {
	ctrl.VulController
}

// @Title List
// @Description 根据指定筛选条件，查询漏洞的数据
// @Param authorization		header string true "token"
// @Param start 			formData int true "查询的资产的起始行数"
// @Param length 			formData int true "返回资产指定的数量"
// @Param vul_source 		formData string false "漏洞的来源(xray、nuclei等）"
// @Param vul_target 		formData string false "漏洞目标"
// @Param vul_poc_file 		formData string false "漏洞的poc"
// @Param date_delta 		formData int false "时间间隔"
// @Success 200 {object} models.VulDataTableResponseData
// @router /list [post]
func (c *VulController) List() {
	c.IsServerAPI = true
	c.ListAction()
}

// @Title Info
// @Description 显示一个漏洞的详情
// @Param authorization		header string true "token"
// @Param id 				formData int true "id"
// @Success 200 {object} models.VulnerabilityInfo
// @router /info [post]
func (c *VulController) Info() {
	c.IsServerAPI = true
	c.InfoAction()
}

// @Title DeleteVul
// @Description 删除一个漏洞
// @Param authorization	header string true "token"
// @Param id 			formData int true "id"
// @Success 200 {object} models.StatusResponseData
// @router /delete [post]
func (c *VulController) DeleteVul() {
	c.IsServerAPI = true
	c.DeleteAction()
}

// @Title LoadXrayPocFile
// @Description 获取xray的pocfile列表
// @Param authorization	header string true "token"
// @Param type 			formData string true "xray漏洞类型（default或custom）"
// @Success 200 {object} models.PocFileList
// @router /xray/pocfile [post]
func (c *VulController) LoadXrayPocFile() {
	c.IsServerAPI = true
	c.LoadXrayPocFileAction()
}

// @Title LoadNucleiPocFile
// @Description 获取Nuclei的pocfile列表
// @Param authorization	header string true "token"
// @Success 200 {object} models.PocFileList
// @router /nuclei/pocfile [post]
func (c *VulController) LoadNucleiPocFile() {
	c.IsServerAPI = true
	c.LoadNucleiPocFileAction()
}
